<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue3 你好世界</title>
    <script src="https://unpkg.com/vue@next"></script>
    <style>
        #app{
            position: relative;
        }
        .overlay{
            width: 100%;
            height: 100%;
            position: absolute;
            background: rgba(0,0,0,.5);
            top:0;
        }
    </style>
</head>
<body>
    <div id="app">
        <overlay></overlay>
    </div>

    <script>
       var root = {};
        const app = Vue.createApp(root);
        app.component('overlay',{
            data(){
                return{
                    show:false
                }
            },
            template:`
            <button @click="show=true">显示</button>
            `
        })
        const vm = app.mount('#app');
    </script>
</body>
</html>